---
import IndexLeft from "../index/IndexLeft.astro";
import IndexRight from "../index/IndexRight.astro";
import CommonContent from "../common/CommonContent.astro";
import CommonTool from "../common/CommonTool.astro";

// 事件传递
const event = function (scrollTop: number) {
  const webTool = document.querySelector("#web-tool");
  const m = document.querySelector("#hot-category-box");
  //主页TAB头部固定
  if (m) {
    if (scrollTop > 580) {
      m.classList.add("hot-category-box");
    } else {
      m.classList.remove("hot-category-box");
    }
  }
  // 工具栏显示隐藏
  if (scrollTop > 200) {
    webTool!.classList.remove("hidden");
  } else {
    webTool!.classList.add("hidden");
  }
};
---

<CommonContent>
  <IndexLeft event={event} />
  <IndexRight />
</CommonContent>
<CommonTool />
